function binding(tbl){
	let cnd=Cnd.where("id","=",tbl.user_id).and("user_type","=",3);
	let u=dao.fetch("cmf_user",cnd)
	if(u==null){
		attr("return",{"error":202,"message":"该会员不存在"})
	}else{
		let cnd2=Cnd.where("info_mac","=",tbl.mac).and("info_status","=",3)
		let app=dao.fetch("cmf_app_info",cnd2)
		if(app!=null){
			let au=dao.fetch("cmf_app_users",Cnd.where("info_mac","=",tbl.mac)
					.and("user_id","=",tbl.user_id))
					if(au!=null){
						let tab=new Record();
						tab.put("_table","cmf_app_users")
						//tab.put("+id","union_id")
						tab.put("app_id",app.app_id)
						tab.put("dev_id",app.user_id)
						tab.put("create_time",Times.time(3))
						tab.put("update_time",Times.time(3))
						tab.put("rssi",isEmpty(tbl.rssi)?null:tbl.rssi)
						dao.insert(tab)
					}else{
						dao.update("cmf_app_users",Chain.make("update_time",Times.time(3))
								,Cnd.where("union_id","=",au.union_id))
					}
			attr("return",{"error":200,"message":"success"})
		}else{
			attr("return",{"error":202,"message":"该mac未绑定应用！"})
		}
	}
	return "json"
}